package com.ssy.lingxi.system.service.impl;

import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.system.dao.LoginPatternRepository;
import com.ssy.lingxi.system.entity.LoginPattern;
import com.ssy.lingxi.system.service.LoginPatternService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class  LoginPatternServiceImpl implements LoginPatternService {

    @Resource
    LoginPatternRepository loginPatternRepository;


    /**
     * 查询登录模式
     * @author wrc
     * @date 2020/6/3
     */
    @Override
    public Wrapper<LoginPattern> loginPatternDeatils() {
        List<LoginPattern> all = loginPatternRepository.findAll();
        return Wrapper.success(all.get(0));
    }

    /**
     * 修改配置
     * @param loginPattern
     * @author wrc
     * @date 2020/6/3
     */
    @Override
    public Wrapper loginPatternUpdate(LoginPattern loginPattern) {
        loginPatternRepository.save(loginPattern);
        return Wrapper.success();
    }


}
